using HCore.IOC.Beans.Factory.Attribute.Attr;
using HCore.IOC.Context.Event;
using HCore.IOC.Context.Event.Attr;
using HCore.Tests.Runtime.DianDianDian.Event;
using HCore.Tests.Runtime.DianDianDian.Model;
using HCore.Tests.Runtime.ShootingEditor2D.Scripts.Support.CommandQuery;
using UnityEngine;

namespace HCore.Tests.Runtime.DianDianDian.Command
{
    public class StartGameCommand : ICommand
    {
    }

    [IOC.Context.Stereotype.Component]
    public class StartGameCommandReceiver : EventPublisher
    {
        [Autowired] private IGameModel mGameModel;

        [EventListener]
        public void OnStartGameCommand(StartGameCommand command)
        {
            Debug.Log("5");
            mGameModel.GameStatus = 1;
            mGameModel.Score = 0;
            mGameModel.Life = 1; // 初始生命为1
            mGameModel.KillCount = 0;
            PublishEvent(new GameStartEvent());
        }
    }
}